// 引入
import request from "@/request/request";
import qs from "qs";

// 精品推荐接口
export const JingpinAPI = () => request.get("/products/recommend");

// 热点推荐
export const HotAPI = () => request.get("/products/hot");

//发送验证码接口
export const SendSMSAPI = (params) =>
  request.post("/sendSMS", qs.stringify(params));

// 发送登录验证码
export const PhoneLoginAPI = (params) => {
  // console.log("PhoneLoginAPI:", params);
  return request.post("/phoneRegin", qs.stringify(params));
};
// 扫码登录
export const WXLoginAPI = (params) => {
  return request.post("/wechatUsers/PCLogin", qs.stringify(params));
};
// 手机绑定微信
export const BindPhoneAPI = (params) => {
  return request.post("/wechatUsers/binding", qs.stringify(params));
};
// 获取用户信息
export const userProfilesAPI = () => request.get("/shop/userProfiles");

// 获取详情页接口
export const detailsAPI = (id) => request.get(`/products/${id}`);

// 加入购物车的请求  /shop/carts/add
export const addToCartAPI = (params) => {
  return request.post("/shop/carts/add", qs.stringify(params));
};
// 获取全部商品接口
export const allGoodsAPI = (params) => request.get("/products", { params });
// 获取购物车数据
export const getCartDataAPI = () => request.get("/shop/carts");
<<<<<<< HEAD
// 删除购物车数据
export const delCartDataAPI = (id) => request.delete(`/shop/carts?productIds=${id}`);
=======
>>>>>>> 42d7f4a3812cbaa13e12bafc11903e5f94f4bd8a
